package com.ruoyi.bl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bl.mapper.BlCompanyMapper;
import com.ruoyi.bl.domain.BlCompany;
import com.ruoyi.bl.service.IBlCompanyService;

/**
 * 下游公司Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-21
 */
@Service
public class BlCompanyServiceImpl implements IBlCompanyService 
{
    @Autowired
    private BlCompanyMapper blCompanyMapper;

    /**
     * 查询下游公司
     * 
     * @param companyId 下游公司主键
     * @return 下游公司
     */
    @Override
    public BlCompany selectBlCompanyByCompanyId(Long companyId)
    {
        return blCompanyMapper.selectBlCompanyByCompanyId(companyId);
    }

    /**
     * 查询下游公司列表
     * 
     * @param blCompany 下游公司
     * @return 下游公司
     */
    @Override
    public List<BlCompany> selectBlCompanyList(BlCompany blCompany)
    {
        return blCompanyMapper.selectBlCompanyList(blCompany);
    }

    /**
     * 新增下游公司
     * 
     * @param blCompany 下游公司
     * @return 结果
     */
    @Override
    public int insertBlCompany(BlCompany blCompany)
    {
        blCompany.setCreateTime(DateUtils.getNowDate());
        return blCompanyMapper.insertBlCompany(blCompany);
    }

    /**
     * 修改下游公司
     * 
     * @param blCompany 下游公司
     * @return 结果
     */
    @Override
    public int updateBlCompany(BlCompany blCompany)
    {
        blCompany.setUpdateTime(DateUtils.getNowDate());
        return blCompanyMapper.updateBlCompany(blCompany);
    }

    /**
     * 批量删除下游公司
     * 
     * @param companyIds 需要删除的下游公司主键
     * @return 结果
     */
    @Override
    public int deleteBlCompanyByCompanyIds(Long[] companyIds)
    {
        return blCompanyMapper.deleteBlCompanyByCompanyIds(companyIds);
    }

    /**
     * 删除下游公司信息
     * 
     * @param companyId 下游公司主键
     * @return 结果
     */
    @Override
    public int deleteBlCompanyByCompanyId(Long companyId)
    {
        return blCompanyMapper.deleteBlCompanyByCompanyId(companyId);
    }
}
